package service.impl;

import mapper.EmployeesMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import po.Employees;
import po.EmployeesExample;
import service.EmployeeService;

import java.util.List;

@Service
public class EmployeeServiceImpl implements EmployeeService {

    @Autowired
    private EmployeesMapper eMapper;

    @Override
    public List<Employees> selectAllEmployees() throws Exception {
        List<Employees> employees = null;
        try{
            EmployeesExample example = new EmployeesExample();
            employees = eMapper.selectByExample(example);
        }catch (Exception e){
            e.printStackTrace();
            throw new Exception("查询出错");
        }
        return employees;
    }

}
